package com.sqznkj.Service;

import com.sqznkj.Dao.AdminDao;
import com.sqznkj.entity.admin;
import com.sqznkj.entity.artcle;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

@Service
public class AdminService {
    @Resource
    AdminDao dao;
    admin ad;

    public admin checkName() throws SQLException {
        ad = dao.checkName();
        return ad;

    }
    public List<artcle> getArtcle(){
        return dao.getArtcle();
    }

    public void add(artcle a) {

        dao.add(a);
    }

    public void delete(String title){
        dao.deleteByTitle(title);
    }
}
